import { NgModule } from '@angular/core';
import { CommonModule } from "@angular/common";
import { BrowserModule, } from '@angular/platform-browser';
import { ReactiveFormsModule,FormsModule } from '@angular/forms';
// import { HttpModule, JsonpModule, Http } from '@angular/http';
import { RouterModule } from '@angular/router';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
// import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate';
// import { ModalModule } from 'ng2-bootstrap/modal';

import { AppComponent } from './app.component';
import { RoutesConfig } from './app.routes';
// import { ArticleModule } from './article/article.module';
// import { UserModule } from "./user/user.module";
// import { userActiveInter } from "./intercept/route/userActiveInter";
// import { QuestionModule } from "./question/question.module";
// import { userService } from "./user/share/user.service";
// import { UserLoginService } from "./user/user-login/shared/user-login.service";
import { ShowModelComponent } from "./common/ShowModel/ShowModel.component";
// import {requestOptionsProvider} from "./DefaultRequestOptions";
import {mainModel} from "./mainModel/main.model";
// export function createTranslateLoader(http: Http) {
//   return new TranslateStaticLoader(http, './assets/i18n', '.json');
// }
import {HashLocationStrategy,LocationStrategy} from '@angular/common';
import { ModalModule } from 'ng2-bootstrap/modal';
import {LoadingComponent} from "./common/loading/loading.component";
@NgModule({
  declarations: [
   AppComponent,
   ShowModelComponent,
   LoadingComponent
  ],
  imports: [
    BrowserModule,
    ReactiveFormsModule,
    FormsModule,
    CommonModule,
    // HttpModule,
    mainModel,
    // JsonpModule,
    BrowserAnimationsModule,
    // TranslateModule.forRoot({
    //   provide: TranslateLoader,
    //   useFactory: (createTranslateLoader),
    //   deps: [Http]
    // }),
    //默认是h5模式导航 hash 模式方式如下
    // RouterModule.forRoot(RoutesConfig,{useHash:true})
    //h5方式
    RouterModule.forRoot(RoutesConfig,{useHash:true}),
    ModalModule.forRoot()
    
  ],
  exports: [RouterModule],
  //解决刷新页面找不到bug
  providers: [{provide: LocationStrategy,useClass: HashLocationStrategy}],
  bootstrap: [AppComponent],
  entryComponents:[LoadingComponent]
})
export class AppModule { }
